#include "Cube.h"

namespace GL
{
    Cube::Cube(const std::string &shaderUrl)
    {
        ObjectData Data;
        Data.l = -0.5f;
        Data.r = 0.5f;
        Data.t = 0.5f;
        Data.b = -0.5f;
        Data.f = -0.5f;
        Data.n = 0.5f;
        Data.R = 1.0f;
        Data.G = 0.0f;
        Data.B = 0.0f;
        Data.A = 1.0f;
        Data.D = 0.0f;
        Data.W = 0.0f;

        unsigned int indices[] = {
            // 注意索引从0开始!
            0, 1, 3, // 第一个三角形
            1, 2, 3  // 第二个三角形
        };

        const std::string texture0 = "D:/learnCode/open-gl/resource/1.jpg";
        const std::string texture1 = "D:/learnCode/open-gl/resource/3.jpg";
        m_Renderer = new CubeRenderer(Data, shaderUrl);
    }

    Cube::~Cube()
    {
    }

    void Cube::Destory()
    {
    }

    void Cube::Render()
    {
        m_Renderer->Render();
    }
    void Cube::Update()
    {
        Render();
    }
}